
package com.jf.cloud.platform.feign;

import com.jf.cloud.api.platform.feign.SysAccessKeyClient;
import com.jf.cloud.api.platform.vo.SysAccessKeyVO;
import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.platform.model.SysAccessKey;
import com.jf.cloud.platform.service.SysAccessKeyService;
import io.swagger.v3.oas.annotations.Hidden;
import ma.glasnost.orika.MapperFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zz
 */
@RestController
@Hidden
public class SysAccessKeyController implements SysAccessKeyClient {

    @Autowired
    private SysAccessKeyService sysAccessKeyService;
    @Autowired
    private MapperFacade mapperFacade;

    @Override
    public ServerResponseEntity<SysAccessKeyVO> getByAccessId(String accessId) {
        SysAccessKey accessKey = sysAccessKeyService.getByAccessId(accessId);
        return ServerResponseEntity.success(mapperFacade.map(accessKey, SysAccessKeyVO.class));
    }
}
